import VueRouter from "vue-router";
import Persons from '../components/Persons.vue';
import Imf from '../components/Imf.vue'
import CheckRN from '../components/CheckRN.vue'
import Account from '../components/Account.vue'
import Collection from '../components/Collection.vue'
import MAddress from '../components/MAddress.vue'
import MInvoice from '../components/MInvoice.vue'
import QRCode from '../components/QRCode.vue'
import Vue from "vue";

const Home = () => import('@/views/home/Home')
const Fresh = () => import('@/components/content/Fresh')
const Necessary = () => import('@/components/content/Necessary')
const TakeAway = () => import('@/components/content/TakeAway')

const Category = () => import('@/views/category/Category')
const Cart = () => import('@/views/cart/Cart')
const Profile = () => import('@/views/profile/Profile')

import Services from '../components/Services.vue';
import Chargeinfo from "../components/Chargeinfo.vue";
import Repair from "../components/Repair.vue";
import Complain from "../components/Complain.vue";
import MyOrder from "../components/MyOrder.vue"
import remoteunclock from "../components/remoteunclock.vue";
import codeunclock from "../components/codeunclock.vue";
import news from "../components/news.vue"
Vue.use(VueRouter);

// import Garbage from "../pages/Garbage.vue";
// import App from "App.vue";
// import CovidCard from "./components/CovidCard.vue";
// import SearchInput from "./components/SearchInput.vue";
// import Service from "./components/Service.vue";
// import ShowBox from "./components/ShowBox.vue";
// import Community from "../pages/Community";

const routes = [{
    path: "/",
    redirect: "/login",
    component: () => import('../views/login/Login')
  },
  {
    path: "/login",
    component: () => import('../views/login/Login')
  },
  {
    path: "/community",
    component: () => import("../pages/Community.vue"),
  },
  {
    path: "/community/garbage",
    component: () => import("../pages/Garbage.vue"),
  },
  {
    path: "/community/news",
    component: () => import("../pages/News.vue"),
  },
  {
    path: "/community/sport/schedule",
    component: () => import("../pages/SportSchedule.vue"),
  },
  {
    path: "/community/sport/problems",
    component: () => import("../pages/SportProblems.vue"),
  },
  {
    path: "/community/sport/lessons",
    component: () => import("../pages/SportLessons.vue"),
  },
  {
    path: "/community/neighbourhoodhelp",
    component: () => import("../pages/NeighbourhoodHelp.vue"),
  },
  {
    path: "/community/neighbourhoodhelp/helpdetails",
    component: () => import("../pages/HelpDetails.vue"),
  },
  {
    path: "/community/notice",
    component: () => import("../pages/Notice.vue"),
  },
  {
    path: '/HomaePage',
    name: 'HomaePage',
    component: () => import('../views/clean/HomePage')
  },
  {
    path: '/Answer',
    name: 'Answer',
    component: () => import('../views/clean/Answer')
  },
  {
    path: '/list',
    component: () => import('../views/clean/List'),
    name: 'list',
    children: [{
        path: 'wash',
        name: 'wash',
        component: () => import('../views/clean/Wash')
      },
      {
        path: 'care',
        name: 'care',
        component: () => import('../views/clean/Care')
      },
      {
        path: 'pipe',
        name: 'pipe',
        component: () => import('../views/clean/Pipe')
      },
      {
        path: 'appliances',
        name: 'appliances',
        component: () => import('../views/clean/Appliances')
      }
    ]
  },
  {
    path: 'detail',
    name: 'detail',
    component: () => import('../views/clean/Detail')
  },
  {
    path: '/persons',
    name: 'Persons',
    component:  Persons
  },
  {
    path: '/imf',
    name:'Imf',
    component: Imf
  },
  {
    path: '/checkrn',
    name:'CheckRN',
    component: CheckRN
  },
  {
    path: '/account',
    name:'Account',
    component: Account
  },
  {
    path: '/collection',
    name:'Collection',
    component: Collection
  },
  {
    path: '/maddress',
    name:'MAddress',
    component: MAddress
  },
  {
    path: '/minvoice',
    name:'MInvoice',
    component: MInvoice
  },
  {
    path: '/qrcode',
    name:'QRCode',
    component: QRCode
  },
  {
    path: '/Services',
    name: 'Services',
    component:  Services
  },
  {
    path: '/Chargeinfo',
    name: 'Chargeinfo',
    component: Chargeinfo
  },
  {
    path: '/Repair',
    name: 'Repair',
    component: Repair
  },
  {
    path: '/Complain',
    name: 'Complain',
    component: Complain
  },
  {
    path: '/MyOrder',
    name: 'MyOrder',
    component: MyOrder
  },
  {
    path: '/remoteunclock',
    name: 'remoteunclock',
    component: remoteunclock
  },
  {
    path: '/codeunclock',
    name: 'codeunclock',
    component: codeunclock
  },
  {
    path: '/news',
    name: 'news',
    component: news
  },
  {
    path: '/home',
    component: Home,
    children: [
      {
        path: '',
        redirect: 'takeaway'
      },
      {
        path: 'takeaway',
        component: TakeAway
      },
      {
        path: 'necessary',
        component: Necessary
      },
      {
        path: 'fresh',
        component: Fresh
      }
    ]
  },
  {
    path: '/category',
    component: Category 
  },
  {
    path: '/cart',
    component: Cart 
  },
  {
    path: '/profile',
    component: Profile 
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;